import QtQuick 2.12

Rectangle{

    id: root
    property bool checked: true

    height: 26
    width: 60
    radius: 4
    color: checked ? "#1677FF" : "#AAAAAA"

    signal release()

    Rectangle{
        y: 1
        height: 24
        width: 35
        radius: 3
        x: checked ? 24 : 1
    }

    MouseArea{
        height: 26
        width: 60
        cursorShape: Qt.PointingHandCursor
        onReleased: {
            checked = !checked
            root.release()
        }
    }

}
